const Koa = require('koa')
const Router = require('@koa/router')

const bodyparser = require('koa-bodyparser')

const app = new Koa()
const router = new Router()
const user = require('./router/user.js')
const menu = require('./router/menu.js')

app.use(bodyparser());
app.use(router.routes())
app.use(router.allowedMethods());

router.get('/', async (ctx) => {
    ctx.body = '欢迎来到首页！'
})
router.use('/user', user.routes());
router.use('/menu', menu.routes());

app.listen(3000);